<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <title>admin</title>

    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="/favicon.ico"/>
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html"/>
    <![endif]-->

    <link rel="stylesheet" type="text/css" href="/static/css/admin/bootstrap.min14ed.css"/>
    <link rel="stylesheet" type="text/css" href="/static/css/admin/font-awesome.min93e3.css"/>
    <link rel="stylesheet" type="text/css" href="/static/css/admin/plugins/dataTables/dataTables.bootstrap.css">
    <link rel="stylesheet" type="text/css" href="/static/css/admin/animate.min.css"/>
    <link rel="stylesheet" type="text/css" href="/static/css/admin/style.min862f.css"/>
    <link href="/static/css/admin/admincommon.css?v=20180820" rel='stylesheet' type='text/css'/>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>实名认证列表</h5>
                    <div class="ibox-tools">
                        <a href="javascript:location.replace(location.href);" class="btn btn-primary btn-circle"
                           type="button" style="margin-bottom:0px;margin-right:10px;position:relative;top:-5px;"
                           title="刷新">
                            <i class="fa fa-refresh"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <!-- <form action="" method="post">
                        <div class="form-group col-sm-3" style="padding-left:0px;">
                            <input type="text" id="keywords" name="keywords" value="{$keywords}" placeholder="输入文章标题" class="form-control" onkeyup="searchTitle(this);" />
                        </div>
                        <button type="submit" class="btn btn-xm btn-primary">搜索</button>
                    </form> -->
                    <table id="mytable" class="table table-striped table-bordered table-hover dataTables-example">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>用户ID</th>
                            <th>用户名</th>
                            <th>真实姓名</th>
                            <th>证件所属国籍</th>
                            <th>证件类型</th>
                            <th>证件号码</th>
                            <th>证件照片合集</th>
                            <th>审核状态</th>
                            <th>申请时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <volist name="data" id="vo">
                            <tr class="gradeX" id="article-{$vo['id']}">
                                <td>{$vo['id']}</td>
                                <td>{$vo['uid']}</td>
                                <td>{$vo['uname']}</td>
                                <td>{$vo['true_name']}</td>
                                <td>{$vo['nation']}</td>
                                <td>
                                    <if condition="$vo['cert_type'] eq 1">
                                        身份证
                                        <elseif condition="$vo['cert_type'] eq 2">
                                            驾照
                                            <else/>
                                            护照
                                    </if>
                                </td>
                                <td>{$vo['cert_num']}</td>
                                <td>
                                    <volist name="$vo['img_data']" id="v">
                                        <a href="{$v}"><img style="width: 100px;height: 70px" src="{$v}" alt=""></a>
                                    </volist>
                                </td>
                                <td>
                                    <if condition="$vo['status'] eq 0">
                                        待审核
                                        <elseif condition="$vo['status'] eq 1">
                                            审核通过
                                            <else/>
                                            审核失败
                                    </if>
                                </td>
                                <td>{$vo['add_time']}</td>
                                <td class="center" align="center">
                                    <div class="btn-group">
                                        <button data-toggle="dropdown" class="btn btn-primary btn-xs dropdown-toggle"
                                                aria-expanded="false">操作 <span class="caret"></span>
                                        </button>
                                        <ul class="dropdown-menu">
                                            <if condition="$vo['status'] eq 0">
                                                <li><a href="javascript:;" data-id="{$vo['id']}" data-value="1"
                                                       class="font-bold update-article">通过</a></li>
                                                <li><a href="javascript:;" data-id="{$vo['id']}" data-value="2"
                                                       class="font-bold update-article">拒接</a></li>
                                            </if>
                                        </ul>
                                    </div>
                                </td>
                            </tr>
                        </volist>
                        </tbody>

                    </table>
                    {$page|raw}
                </div>
            </div>
        </div>
    </div>
</div>
<js href="/static/js/admin/jquery.min.js"/>
<js href="/static/js/admin/bootstrap.min.js"/>
<js href="/static/js/admin/content.min.js"/>
<js href="/static/js/admin/plugins/layui/layer/layer.js"/>
<script type="text/javascript" src="/static/js/admin/admincommon.js?v=20180820"></script>

<script>
    $(document).ready(function () {

        $(".ibox-content").on('click', '.update-article', function () {
            var id = $(this).data("id");
            var status = $(this).data("value");
            layer.confirm("你确定要审核ID为【" + id + "】的记录吗？", {

                btn: ['确定', '取消'] //按钮

            }, function () {

                $.post("{:url('admin/User/checkAuth')}", {id: id, status: status}, function (data) {

                    if (data.code == 1) {

                        layer.msg(data.msg, {time: 500, icon: 1});


                    } else {

                        layer.msg(data.msg, {time: 500, icon: 2});

                    }

                }, 'json');
                window.location.replace(location.href);

            });
        });
    })

    function searchTitle(obj) {
        var keywords = $.trim($(obj).val());

        if (keywords.length <= 0) {
            window.location.replace(location.href);
        }
    }

</script>

</body>
</html>